/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sg.edu.nus.iss.pacman.manager.bluetooth;

import sg.edu.nus.iss.pacman.manager.*;
import sg.edu.nus.iss.pacman.net.bluetooth.server.*;
import sg.edu.nus.iss.pacman.midlet.PacManScreen;

/**
 * A manager class for bluetooth server.
 * @author fredy
 */
public class BluetoothServerManager implements BluetoothServerListener, GameChallengeReceiver
{
    private PacManScreen screen;
    private BluetoothServer server;

    /**
     * Creates a new instance of BluetoothServerManager.
     * @param screen the pacman screen
     */
    public BluetoothServerManager(PacManScreen screen)
    {
        this.screen = screen;
        server = new BluetoothServer(this);
    }

    public void receiveChallenge()
    {
        server.receiveMessage();
    }

    public void received(String message)
    {
        screen.displayMainMenu();
    }
}
